package cn.edu.nwpu.warehousemanagement.util;

/**
 * 用户上下文工具类，
 * 可用来获取执行当前操作的用户 这个之后应该要改 todo
 * @Deprecated
 * @author LSR
 */
public class UserContext {
    private static final ThreadLocal<Long> userThreadLocal = new ThreadLocal<>();

    public static Long getCurrentUserId() {
        return userThreadLocal.get();
    }

    public static void setCurrentUserId(Long userId) {
        userThreadLocal.set(userId);
    }

    public static void clear() {
        userThreadLocal.remove();
    }
}
